import { NgModule } from '@angular/core';
import { RouterModule, NavigationEnd, Router } from '@angular/router';
import { CutleryComponent } from './cutlery/cutlery.component';

@NgModule({
    imports: [
        RouterModule.forChild([
            {
                path: '',
                children: [{ path: 'cutlery', component: CutleryComponent }]
            }
        ])
    ],
    exports: [RouterModule]
})
export class CutleriesRoutingModule {
    constructor(private router: Router) {
        router.events.subscribe(event => {
            if (event instanceof NavigationEnd) {
                window.scroll(0, 0);
            }
        });
    }
}
